<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: itrim</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: itrim</td>
      <td class="subheader-left"><a href="matlab:open itrim">View code for itrim</a></td>
    </tr>
  </table>
<h1>itrim</h1><p><span class="helptopic">Trim images</span></p><p>
This function has two different modes of functionality.

</p>
<p>
<strong>out</strong> = <span style="color:red">itrim</span>(<strong>im</strong>, <strong>sides</strong>, <strong>n</strong>) is the image <strong>im</strong> with <strong>n</strong> pixels removed from the
image sides as specified by <strong>sides</strong> which is a string containing one or
more of the characters:

</p>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 't'</td> <td>top</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'b'</td> <td>bottom</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'l'</td> <td>left</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'r'</td> <td>right</td></tr>
</table>
<p>
[<strong>out1</strong>,<strong>out2</strong>] = <span style="color:red">itrim</span>(<strong>im1</strong>,<strong>im2</strong>) returns the central parts of images <strong>im1</strong> and
<strong>im2</strong> as <strong>out1</strong> and <strong>out2</strong> respectively.  When images are rectified or warped
the shapes can become quite distorted and are embedded in rectangular images
surrounded by black of NaN values.  This function crops out the
central rectangular region of each.  It assumes that the undefined pixels
in <strong>im1</strong> and <strong>im2</strong> have values of NaN.  The same cropping is applied to each
input image.

</p>
<p>
[<strong>out1</strong>,<strong>out2</strong>] = <span style="color:red">itrim</span>(<strong>im1</strong>,<strong>im2</strong>,<strong>T</strong>) as above but the threshold <strong>T</strong> in the range
0 to 1 is used to adjust the level of cropping.  The default is 0.5, a
higher value will include fewer NaN value in the result (smaller region),
a lower value will include more (larger region).  A value of 0 will ensure
that there are no NaN values in the returned region.

</p>
<h2>See also</h2>
<p>
<a href="matlab:doc homwarp">homwarp</a>, <a href="matlab:doc irectify">irectify</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2012 Peter Corke.</p>
</body></html>